#ifndef _MQTT_HANDLER_H_
#define _MQTT_HANDLER_H_

#include "esp_err.h"

#define KEY_VALUE_TOPIC       "/topic/key_value"
#define LED_STATUS_TOPIC      "/topic/led_status"

#define TXD_PIN (GPIO_NUM_17)
#define RXD_PIN (GPIO_NUM_16)

typedef esp_err_t (*mqtt_msg_handler_func_t)(const char *p_topic,int topic_len,const char *p_data,int data_len);

typedef struct str_mqtt_msg_handler
{
    char *topic;
    char *data;
    mqtt_msg_handler_func_t mqtt_msg_handler;
}mqtt_msg_handler_t;

extern void mqtt_handler_init(void);
extern int mqtt_publish_message(const char* p_topic,const char* p_data,int len);

#endif

